package com.imooc.user.controller;

import com.imooc.api.controller.user.HelloControllerApi;
import com.imooc.grace.result.GraceJSONResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController implements HelloControllerApi {

    private final static Logger logger = LoggerFactory.getLogger(HelloController.class);

    // 在接口里写了GetMapping注解，实现中就不用写了
    public Object hello() {
        logger.info("hello");
        logger.debug("hello");
        logger.warn("hello");
        logger.error("hello");
//        return "hello";
        return GraceJSONResult.errorMsg("测试返回错误信息");
    }
}
